package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;
import java.util.HashMap;

/**
 * 班级
 */
@Getter
@Setter
@ToString
public class Classinfo {
    /**
     * 班级id
     */
    private Long id;
    /**
     * 班级名称
     */
    private String name;
    /**
     * 班级人数
     */
    private Integer number;
    /**
     * 班级员工
     */
    private Employee emp = new Employee();

    /**
     * 获取班级json的数据
     *
     * @return
     */
    public String getJson() {
        HashMap map = new HashMap();
        map.put("id", id);
        map.put("name", name);
        map.put("number", number);
        map.put("employeeId", emp.getId());
        return JSON.toJSONString(map);
    }

}